var $ = Object.defineProperty, x = Object.defineProperties;
var N = Object.getOwnPropertyDescriptors;
var s = Object.getOwnPropertySymbols;
var b = Object.prototype.hasOwnProperty, k = Object.prototype.propertyIsEnumerable;
var l = (e, o, r) => o in e ? $(e, o, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[o] = r, u = (e, o) => {
  for (var r in o || (o = {}))
    b.call(o, r) && l(e, r, o[r]);
  if (s)
    for (var r of s(o))
      k.call(o, r) && l(e, r, o[r]);
  return e;
}, m = (e, o) => x(e, N(o));
import { computed as i } from "vue";
import { c as P } from "../component-87e22bdd.mjs";
import { p as f } from "../pxCheck-fb1b9a66.mjs";
import { u as h } from "../useInject-3a196f18.mjs";
import { u as w } from "../index-2c70f71d.mjs";
import { G as z } from "../common-27a18dce.mjs";
import { c as q } from "../props-c0e5b20d.mjs";
/*!
* Vin UI 移动端 Vue3 组件库 v0.2.9 Fri Jun 02 2023 21:01:02 GMT+0800 (中国标准时间)
* (c) 2023 @vingogo.
* Released under the MIT License.
*/
const v = m(u({}, q), {
  text: {
    type: String
  },
  icon: {
    type: String
  },
  iconSize: {
    type: [Number, String]
  },
  iconColor: {
    type: String
  },
  iconClassPrefix: {
    type: String
  },
  iconFontClassName: {
    type: String
  },
  to: {
    type: [String, Object]
  },
  // #ifdef H5
  url: {
    type: String,
    default: ""
  },
  // #endif
  replace: {
    type: Boolean,
    default: !1
  }
}), { create: I, componentName: R, useVinContext: _ } = P("grid-item"), O = I({
  props: v,
  emits: ["click"],
  setup(e, { emit: o }) {
    const { getMainClass: r, getMainStyle: d } = _(e), c = h(z);
    if (!c.parent)
      return {};
    const { index: g } = c, t = c.parent.props || {}, p = i(r), C = i(() => {
      const n = {
        flexBasis: `${100 / +t.columnNum}%`
      };
      return t.square ? n.paddingTop = `${100 / +t.columnNum}%` : t.gutter && (n.paddingRight = f(t.gutter), g.value >= t.columnNum && (n.marginTop = f(t.gutter))), d(n);
    }), S = i(() => {
      const n = `${R}__content`;
      return {
        [`${n}`]: !0,
        [`${n}--border`]: t.border,
        [`${n}--surround`]: t.border && t.gutter,
        [`${n}--center`]: t.center,
        [`${n}--square`]: t.square,
        [`${n}--reverse`]: t.reverse,
        [`${n}--${t.direction}`]: !!t.direction,
        [`${n}--clickable`]: t.clickable
      };
    }), y = i(() => ({
      name: e.icon,
      size: e.iconSize || t.iconSize,
      color: e.iconColor || t.iconColor,
      classPrefix: e.iconClassPrefix,
      fontClassName: e.iconFontClassName
    })), a = w();
    return {
      mainClass: p,
      mainStyle: C,
      contentClass: S,
      iconProps: y,
      handleClick: (n) => {
        o("click", n), e.to && a ? a[e.replace ? "replace" : "push"](e.to) : e.url && (e.replace ? window.location.replace(e.url) : window.location.href = e.url);
      }
    };
  }
});
export {
  O as default
};
